package org.uim.cricket.updater.fetch.impl;

import org.uim.cricket.updater.fetch.URLGeneratable;

public class FileSystemURLGenerator implements URLGeneratable {
	
	@Override
	public String generateURL(String[] args) {
		if (args == null || args.length == 0) return null;
		StringBuilder file = new StringBuilder();
		for (int i=0;i<args.length;i++) {
			if (args[i].startsWith("/")) args[i] = args[i].substring(1);
			if (!args[i].endsWith("/") && i < args.length - 1) args[i] = args[i] + "/";
			file.append(args[i]);
		}
		return file.toString();
	}
	
}
